<?php
//  $this->set('channel', array(

//    'title' => 'Recent posts',

//    'link' => $this->Rss->url('/', true),

//    'description' => 'New posts on my blog'

// ));

$items = array();
foreach ($posts as $post) {
	$postLink = array(
			'controller' => 'news',
			'action' => 'detail',
			'news_rewrite' => $post['News']['new_rewrite'],
			'full_base' => true,
			'ext' => 'html',
	);

	$bodyText = h(strip_tags($post['News']['brief']));
	$bodyText = $this->Text->truncate($bodyText, 600, array(
			'ending' => '...',
			'exact'  => true,
			'html'   => true,
	));

	$items[] = array(
			'title' => $post['News']['name'],
			'link' => $postLink,
			'description' => $bodyText,//array('cdata' => true, 'value' => $post['News']['brief']),
			'pubDate' => date('d-m-Y', $post['News']['create_time']),
	);
}

echo $this->Rss->items($items);